﻿using EasyMapping.Common.Utility;
using log4net.Config;
using log4net;
using System.IO;

namespace EasyMapping.Common.Logging
{
    public class Log4NetUtil
    {
        #region " Static Contructor "

        static Log4NetUtil()
        {
            FileInfo file = FileHelper.GetFileFromCurrentDirectory(@"\log4net.xml");
            XmlConfigurator.ConfigureAndWatch(file);
        } 

        #endregion

        #region " Get Logger "

        public static ILog GetCommonLogger()
        {
            return LogManager.GetLogger("CommonLogger");
        }

        public static ILog GetCustomLogger(string name)
        {
            return LogManager.GetLogger(name);
        } 

        #endregion

    }
}
